package SV_AUTH_HASH_MUST;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Fixed {
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String password = request.getParameter("password"); //Source
        String md5 = getMd5(password);
       //...
    }
    public static String getMd5(String str)
    {
        try {
            MessageDigest md = MessageDigest.getInstance("SHA3-256");
            byte[] messageDigest = md.digest(str.getBytes());
            //...
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
        return "";
    }
}
